package design_pattern.ActiveObjects;

/**
 * @Author: 蔡翔
 * @Date: 2019/11/27 16:22
 * @Version 1.0\
 *
 * 静态工厂
 */
public final class ActiveObjectFactory {
    private ActiveObjectFactory(){

    }
    public static ActiveObject createActiveObject(){
        Servant servant = new Servant();
        ActivationQueue queue= new ActivationQueue();
        SchedualerThread schedualerThread = new SchedualerThread(queue);
        ActiveObjectProxy proxy = new ActiveObjectProxy(schedualerThread,servant);
        schedualerThread.start();
        return proxy;
    }
}
